<%@ page language="java"%>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html:html locale="true">
<head>
<html:base />
<title>Application Content Generator</title>
<meta http-equiv="Content-Language" content="Spanish" />
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link href="<%= request.getContextPath() %>/style/appcongen.css" rel="stylesheet" type="text/css" />

<script language="JavaScript1.2">
		function toggle(id) {
			var obj=document.getElementById(id);
			obj.style.display = (obj.style.display == 'block') ? obj.style.display = 'none' : obj.style.display = 'block';
		}
</script>

</head>

<body>

<div id="container"><%@ include
	file="/jsp/includes/common-header-menu.jsp"%>

<div id="container-content">
<h4>Listado de Templates</h4>
<logic:empty name="templateListForm" property="templates">
	No existen templates para completar.
</logic:empty>
<logic:notEmpty name="templateListForm" property="templates">
	<div style="overflow:auto ; height: 350px ">
	<logic:iterate name="templateListForm" property="templates" id="template">

		<div style="font-weight: normal; padding-left: 20px; background: #FFFFFF; color: #666666; ">
			
			<logic:equal name="template" property="class"
				value="class com.soft.sitegenerator.business.hibernate.SimpleTemplate">
					<div style="padding-left: 0px">
						- Nombre:&nbsp;<b><bean:write name="template" property="name" /></b>&nbsp;&nbsp;&nbsp;
						P&aacute;gina:&nbsp;<b><bean:write name="template" property="sitePage.name" />&nbsp;-&nbsp;<bean:write name="template" property="sitePage.webSite.name" /></b>&nbsp;&nbsp;&nbsp;
						<a href="javascript:window.location.href='<%= request.getContextPath() %>/templateEdit.do?do=editTemplate&id=<bean:write name="template" property="id" />'">Editar</a>
						<logic:notEmpty name="template" property="text">
						<br />
						&nbsp;&nbsp;Texto:&nbsp;<i><bean:write name="template" property="text" /></i>&nbsp;&nbsp;&nbsp;
						</logic:notEmpty>
						<br />
					</div>
					<br />
			</logic:equal>

			<logic:equal name="template" property="class"
				value="class com.soft.sitegenerator.business.hibernate.CompositeTemplate">
					<div style="padding-left: 0px">
						- Template Compuesto:&nbsp;<b><bean:write name="template" property="name" /></b>&nbsp;&nbsp;&nbsp;
						P&aacute;gina:&nbsp;<b><bean:write name="template" property="sitePage.name" />&nbsp;-&nbsp;<bean:write name="template" property="sitePage.webSite.name" /></b>&nbsp;&nbsp;&nbsp;
						<br />
					</div>
					<br />
					<logic:notEmpty name="template" property="templates">
						<logic:iterate name="template" property="templates" id="template2">
							<div style="padding-left: 10px">
							Nombre:&nbsp;<b><bean:write name="template2" property="name" /></b>&nbsp;&nbsp;&nbsp;
							<a href="javascript:window.location.href='<%= request.getContextPath() %>/templateEdit.do?do=editTemplate&id=<bean:write name="template2" property="id" />'">Editar</a>
							<logic:notEmpty name="template2" property="text">
							<br />
							Texto:&nbsp;<i><bean:write name="template2" property="text" /></i>&nbsp;&nbsp;&nbsp;
							</logic:notEmpty>
							<br />
							<br />
							</div>
						</logic:iterate>
					</logic:notEmpty>
					<br />
			</logic:equal>

		</div>
	</logic:iterate>
	</div>
</logic:notEmpty>
<br />
<br />

</div>

<br />
<br />
<%@ include file="/jsp/includes/common-footer.jsp"%>

</div>

</body>
</html:html>
